/* 
 * File:   Task.h
 * Author: Nicolas Proust & Pierre-Antoine Jahan
 *
 * Created on 22 janvier 2013, 16:40
 */

#ifndef TASK_H
#define	TASK_H

#include <string>
#include <list>
#include <ctime>
#include <iostream>
#include "Date.h"

using namespace std;

class Task {
public:
    Task(string title, bool isOrdo, int nombre, bool isEcheance, bool fixe);
    Task(string title, bool isOrdo, int nombre, bool isEcheance, bool fixe, Date d, int relat);
    virtual ~Task();
    
    //getters and setters
    void setNumber(int number);
    int getNumber() const;
    void setOrdo(bool ordo);
    bool isOrdo() const;
    void setTitre(string titre);
    string getTitre() const;
    void setDate(Date d);
    Date getDate() const;
    void setEcheance(bool ech);
    bool isEcheance() const;
    void setFixe(bool fixe);
    bool isFixe() const;
    int getRelative() const;
    void setRelative(int relat);
    bool isChecked() const;
    void setChecked(bool checked);   
    void addTask(Task* t);
    void removeTask(Task* t);
    list<Task*> getTasks() const;

private:
    string titre_;
    bool ordo_;
    int number_;
    bool ech_;
    bool fixe_;
    Date date_;
    int relat_;
    bool checked_;
    list<Task*> tasksList;

};

int operator==(const Task& a, const Task& b);
bool operator < (const Task& a, const Task& b);
bool orderByNumber(const Task t1, const Task t2);

#endif	/* TASK_H */

